//package com.asset.crm.dao;
//
//import java.util.ArrayList;
//import java.util.List;
//
//import org.hibernate.Query;
//import org.hibernate.Session;
//import org.springframework.stereotype.Repository;
//
//import com.asset.crm.domain.Call;
//
//@Repository
//public class CallDaoImpl extends BasicDaoImpl<Call>{
//
//	public List<Call> getCallByParentId(Integer parentId, String parentType){
//		Session session = sessionFactory.getCurrentSession();
//		Query query = session.createQuery("from Call where  parentId = :parentId and parentType = :parentType");
//		query.setParameter("parentId", parentId);
//		query.setParameter("parentType", parentType);
//		@SuppressWarnings("unchecked")
//		List<Call>  calls= query.list();
//		if(calls != null && calls.size() > 0)
//		return calls;
//		else
//		return new ArrayList<Call>();
//	}
//	public void saveOrUpdate(Call  call){
//		Session session =  sessionFactory.getCurrentSession();
//		session.saveOrUpdate(call);
//	}
//	@SuppressWarnings("unchecked")
//	public List<Call> getCallEventsByEmployeeId(Integer empId,Integer parentId) {
//		Session session = sessionFactory.getCurrentSession();
//		Query query = session.createQuery("from Call where  crmStaff.id = :empId And parentId=:parentId");
//		query.setParameter("empId", empId);
//		query.setParameter("parentId", parentId);
//		@SuppressWarnings("unchecked")
//		List<Call>  events = new ArrayList<Call>();
//		events= query.list();
//		return events;
//		
//	}
//	
//	@SuppressWarnings("unchecked")
//	public List<Call> getCallEventsByEmployeeIdAndDate(Integer empId) {
//		Session session = sessionFactory.getCurrentSession();
//		Query query = session.createQuery("from Call where  crmStaff.id = :empId");
//		query.setParameter("empId", empId);
//		@SuppressWarnings("unchecked")
//		List<Call>  events = new ArrayList<Call>();
//		events= query.list();
//		return events;
//		
//	}
//}
